﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace LocalizationProvider
{
    /// <summary>
    /// Represent the confiration settings for LocalizationProvider
    /// </summary>
    public class LocalizationConfiguration : ConfigurationSection
    {
        /// <summary>
        /// Get all configured providers
        /// </summary>
        [ConfigurationProperty("providers")]
        public ProviderSettingsCollection Providers
        {
            get { return base["providers"] as ProviderSettingsCollection; }
        }

        /// <summary>
        /// Get or set the default provider
        /// </summary>
        [ConfigurationProperty("defaultProvider", DefaultValue = "XmlLocalizationProvider")]
        public string DefaultProvider
        {
            get { return base["defaultProvider"] as string; }
            set { base["defaultProvider"] = value; }
        }

        /// <summary>
        /// Get or set all the cultures that are allowed to localize
        /// </summary>
        [ConfigurationProperty("cultures")]
        public string Cultures
        {
            get { return base["cultures"] as string; }
            set { base["cultures"] = value; }
        }

        /// <summary>
        /// Get or set the default culture which is used when no culture is specified
        /// </summary>
        [ConfigurationProperty("defaultCulture", DefaultValue = "en-US")]
        public string DefaultCulture
        {
            get { return base["defaultCulture"] as string; }
            set { base["defaultCulture"] = value; }
        }

        /// <summary>
        /// Get or set the source of the provider.
        /// Example a path to the files or connection string to a database
        /// </summary>
        [ConfigurationProperty("source")]
        public string Source
        {
            get { return base["source"] as string; }
            set { base["source"] = value; }
        }
    }
}
